package lang;

import java.lang.reflect.Method;

public class SortableMethodEntity implements Comparable<SortableMethodEntity> {

    private Method method;
    private int sort;

    public SortableMethodEntity(Method method, int sort) {
        this.method = method;
        this.sort = sort;
    }

    @Override
    public int compareTo(SortableMethodEntity o) {
        return -(sort - o.getSort());
    }

    public Method getMethod() {
        return method;
    }

    public int getSort() {
        return sort;
    }

    @Override
    public String toString() {
        return "SortableMethodEntity{" +
                "method=" + method +
                ", sort=" + sort +
                '}';
    }
}